LogarithmicSp

class LogarithmicSp(val initialBaseValue: Number, val defaultFontScale: Boolean = true, val sortedCustomEntries: List<CustomSpEntry> = emptyList(), val ignoreMultiWindows: Boolean = false, val applyAspectRatio: Boolean = false, val customSensitivityK: Float? = null)

EN A class that allows defining custom Sp text dimensions based on screen qualifiers (UiModeType, Width, Height, Smallest Width).

The value is resolved using a Context and uses the base value or a custom value, applying dynamic scaling.

PT Classe que permite definir dimensões de texto Sp customizadas baseadas em qualificadores de tela (UiModeType, Largura, Altura, Smallest Width).

Constructors

Link copied to clipboard
private constructor(initialBaseValue: Number, defaultFontScale: Boolean = true, sortedCustomEntries: List<CustomSpEntry> = emptyList(), ignoreMultiWindows: Boolean = false, applyAspectRatio: Boolean = false, customSensitivityK: Float? = null)
constructor(initialBaseValue: Number)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun aspectRatio(enable: Boolean = true, sensitivityK: Float? = null): LogarithmicSp

EN Allow applying aspect ratio based constraint scaling. PT Permite aplicar o redimensionamento baseado na proporção da tela.

Link copied to clipboard

EN Allow ignoring the constraint scaling based on multi-window resizing properties. PT Permite ignorar o dimensionamento para os layouts de múltiplas janelas (divisão de tela).

Link copied to clipboard
fun loghem(context: Context): Float
Link copied to clipboard
fun loghsp(context: Context): Float
Link copied to clipboard
fun logsem(context: Context): Float

EN Resolve final value in pixels (WITHOUT font scale).

Link copied to clipboard

EN Resolves logsem, loghem, and logwem in one pass (fixed Sp / no font-scale path). PT Resolve logsem, loghem e logwem numa só passagem (Sp fixo / sem escala de fonte).

Link copied to clipboard
fun logssp(context: Context): Float

EN Resolve final value in pixels (WITH font scale).

Link copied to clipboard

EN Resolves logssp, loghsp, and logwsp in one pass (single UiModeType.fromConfiguration read). PT Resolve logssp, loghsp e logwsp numa só passagem.

Link copied to clipboard
fun logwem(context: Context): Float
Link copied to clipboard
fun logwsp(context: Context): Float
Link copied to clipboard

EN Adds a new entry and re-sorts the list by priority, then by qualifier value (descending).

Link copied to clipboard
private fun resolvePx(context: Context, qualifier: DpQualifier, fontScaleOverride: Boolean? = null): Float

EN Resolves qualifier to px using the first matching CustomSpEntry, optionally overriding font scale. PT Resolve qualifier em px usando a primeira CustomSpEntry correspondente, com override opcional da escala de fonte.

Link copied to clipboard
private fun resolvePxInternal(context: Context, qualifier: DpQualifier, configuration: Configuration, currentUiModeType: UiModeType, fontScaleOverride: Boolean?): Float

EN Shared implementation for resolvePx, logsspLoghspLogwspPx, and logsemLoghemLogwemPx. PT Implementação compartilhada para resolvePx, logsspLoghspLogwspPx e logsemLoghemLogwemPx.

Link copied to clipboard
fun screen(orientation: Orientation = Orientation.DEFAULT, customValue: Number, finalQualifierResolver: DpQualifier? = null, inverter: Inverter = Inverter.DEFAULT, fontScale: Boolean = defaultFontScale): LogarithmicSp

EN Priority 4: orientation only. PT Prioridade 4: apenas orientação.

fun screen(type: UiModeType, customValue: Number, finalQualifierResolver: DpQualifier? = null, orientation: Orientation = Orientation.DEFAULT, inverter: Inverter = Inverter.DEFAULT, fontScale: Boolean = defaultFontScale): LogarithmicSp

EN Priority 2: UiModeType only (e.g. TELEVISION, WATCH). PT Prioridade 2: apenas UiModeType (ex.: TELEVISION, WATCH).

fun screen(type: DpQualifier, value: Int, customValue: Number, finalQualifierResolver: DpQualifier? = null, orientation: Orientation = Orientation.DEFAULT, inverter: Inverter = Inverter.DEFAULT, fontScale: Boolean = defaultFontScale): LogarithmicSp

EN Priority 3: Dp qualifier (sw, h, w) without UiModeType restriction. PT Prioridade 3: qualificador Dp (sw, h, w) sem restrição de UiModeType.

fun screen(uiModeType: UiModeType, qualifierType: DpQualifier, qualifierValue: Number, customValue: Number, finalQualifierResolver: DpQualifier? = null, orientation: Orientation = Orientation.DEFAULT, inverter: Inverter = Inverter.DEFAULT, fontScale: Boolean = defaultFontScale): LogarithmicSp

EN Priority 1: Most specific qualifier — combines UiModeType and Dp qualifier (sw, h, w). PT Prioridade 1: qualificador mais específico — combina UiModeType e qualificador Dp (sw, h, w).